/*----------------------------------------------------------------------------*/
/* Team 3647
/* Main.java
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.IterativeRobot;

public class Main extends IterativeRobot {

    public void robotInit() {
        CompressorClass.CompInit();
        Shooter.EncoderStart();
        //DashBoard.initPIDDash();
    }
    
    private static boolean autonRun = false;
    public void disabledInit() {
        autonRun = false;
        Shooter.EncoderReset();
    }
    
    public void autonomousPeriodic() {
        if (PSoC.getDigital(2)) {
            if(!autonRun) {
                AutonProcess.FireBalls();
                autonRun = true;
            }
        }
    }
    
    public void teleopPeriodic() {
        DashBoard.updateDashboard();
        
        Tower.BallLift();
        Tower.BallStop();
            
        Shooter.hood();
        
        Turret.Spin();
        Turret.CameraPan();
    }
    
    public void teleopContinuous() {        
        DriveBase.TankCD();
        //Shooter.OpenLoop();
        
        Shooter.ClosedLoop();
        //System.out.println(Shooter.getRate());
        //Shooter.ShooterVictor.set(-1);
        //System.out.println(Shooter.getRate());
    }
}